<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE Unsafe #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE NoImplicitPrelude, RoleAnnotations #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# OPTIONS_GHC -funbox-strict-fields #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# OPTIONS_HADDOCK not-home #-}</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Module      :  GHC.IOArray</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow 2008</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- License     :  see libraries/base/LICENSE</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Maintainer  :  cvs-ghc@haskell.org</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Stability   :  internal</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Portability :  non-portable (GHC Extensions)</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- The IOArray type</span><span>
</span><span id="line-17"></span><span class="hs-comment">--</span><span>
</span><span id="line-18"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.IOArray</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-21"></span><span>        </span><span class="annot"><a href="GHC.IOArray.html#IOArray"><span class="hs-identifier">IOArray</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>        </span><span class="annot"><a href="GHC.IOArray.html#newIOArray"><span class="hs-identifier">newIOArray</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.IOArray.html#unsafeReadIOArray"><span class="hs-identifier">unsafeReadIOArray</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.IOArray.html#unsafeWriteIOArray"><span class="hs-identifier">unsafeWriteIOArray</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-23"></span><span>        </span><span class="annot"><a href="GHC.IOArray.html#readIOArray"><span class="hs-identifier">readIOArray</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.IOArray.html#writeIOArray"><span class="hs-identifier">writeIOArray</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>        </span><span class="annot"><a href="GHC.IOArray.html#boundsIOArray"><span class="hs-identifier">boundsIOArray</span></a></span><span>
</span><span id="line-25"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-26"></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.IO.html"><span class="hs-identifier">GHC.IO</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Arr.html"><span class="hs-identifier">GHC.Arr</span></a></span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-32"></span><span class="hs-comment">-- | An 'IOArray' is a mutable, boxed, non-strict array in the 'IO' monad.</span><span>
</span><span id="line-33"></span><span class="hs-comment">-- The type arguments are as follows:</span><span>
</span><span id="line-34"></span><span class="hs-comment">--</span><span>
</span><span id="line-35"></span><span class="hs-comment">--  * @i@: the index type of the array (should be an instance of 'Ix')</span><span>
</span><span id="line-36"></span><span class="hs-comment">--</span><span>
</span><span id="line-37"></span><span class="hs-comment">--  * @e@: the element type of the array.</span><span>
</span><span id="line-38"></span><span class="hs-comment">--</span><span>
</span><span id="line-39"></span><span class="hs-comment">--</span><span>
</span><span id="line-40"></span><span>
</span><span id="line-41"></span><span class="hs-keyword">newtype</span><span> </span><span id="IOArray"><span class="annot"><a href="GHC.IOArray.html#IOArray"><span class="hs-identifier hs-var">IOArray</span></a></span></span><span> </span><span id="local-6989586621679562562"><span class="annot"><a href="#local-6989586621679562562"><span class="hs-identifier hs-type">i</span></a></span></span><span> </span><span id="local-6989586621679562561"><span class="annot"><a href="#local-6989586621679562561"><span class="hs-identifier hs-type">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="IOArray"><span class="annot"><a href="GHC.IOArray.html#IOArray"><span class="hs-identifier hs-var">IOArray</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Arr.html#STArray"><span class="hs-identifier hs-type">STArray</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#RealWorld"><span class="hs-identifier hs-type">RealWorld</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562562"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562561"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span class="hs-comment">-- index type should have a nominal role due to Ix class. See also #9220.</span><span>
</span><span id="line-44"></span><span class="hs-keyword">type</span><span> </span><span class="hs-keyword">role</span><span> </span><span class="annot"><a href="GHC.IOArray.html#IOArray"><span class="hs-identifier hs-type">IOArray</span></a></span><span> </span><span class="annot"><span class="hs-identifier">nominal</span></span><span> </span><span class="annot"><span class="hs-identifier">representational</span></span><span>
</span><span id="line-45"></span><span>
</span><span id="line-46"></span><span class="hs-comment">-- explicit instance because Haddock can't figure out a derived one</span><span>
</span><span id="line-47"></span><span class="hs-comment">-- | @since 4.1.0.0</span><span>
</span><span id="line-48"></span><span id="local-6989586621679562582"><span id="local-6989586621679562583"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679562514"><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-type">Eq</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.IOArray.html#IOArray"><span class="hs-identifier hs-type">IOArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562583"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562582"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-49"></span><span>  </span><span class="annot"><a href="GHC.IOArray.html#IOArray"><span class="hs-identifier hs-type">IOArray</span></a></span><span> </span><span id="local-6989586621679562510"><span class="annot"><span class="annottext">STArray RealWorld i e
</span><a href="#local-6989586621679562510"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679562509"><span class="annot"><span class="annottext">== :: IOArray i e -&gt; IOArray i e -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">==</span></a></span></span><span> </span><span class="annot"><a href="GHC.IOArray.html#IOArray"><span class="hs-identifier hs-type">IOArray</span></a></span><span> </span><span id="local-6989586621679562508"><span class="annot"><span class="annottext">STArray RealWorld i e
</span><a href="#local-6989586621679562508"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">STArray RealWorld i e
</span><a href="#local-6989586621679562510"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">STArray RealWorld i e -&gt; STArray RealWorld i e -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">STArray RealWorld i e
</span><a href="#local-6989586621679562508"><span class="hs-identifier hs-var">y</span></a></span></span></span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span class="hs-comment">-- |Build a new 'IOArray'</span><span>
</span><span id="line-52"></span><span id="local-6989586621679562576"><span id="local-6989586621679562577"><span class="annot"><a href="GHC.IOArray.html#newIOArray"><span class="hs-identifier hs-type">newIOArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562577"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679562577"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679562577"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679562576"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.IOArray.html#IOArray"><span class="hs-identifier hs-type">IOArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562577"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562576"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-53"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.IOArray.html#newIOArray"><span class="hs-pragma hs-type">newIOArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-54"></span><span id="newIOArray"><span class="annot"><span class="annottext">newIOArray :: forall i e. Ix i =&gt; (i, i) -&gt; e -&gt; IO (IOArray i e)
</span><a href="GHC.IOArray.html#newIOArray"><span class="hs-identifier hs-var hs-var">newIOArray</span></a></span></span><span> </span><span id="local-6989586621679562502"><span class="annot"><span class="annottext">(i, i)
</span><a href="#local-6989586621679562502"><span class="hs-identifier hs-var">lu</span></a></span></span><span> </span><span id="local-6989586621679562501"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679562501"><span class="hs-identifier hs-var">initial</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ST RealWorld (IOArray i e) -&gt; IO (IOArray i e)
forall a. ST RealWorld a -&gt; IO a
</span><a href="GHC.IO.html#stToIO"><span class="hs-identifier hs-var">stToIO</span></a></span><span> </span><span class="annot"><span class="annottext">(ST RealWorld (IOArray i e) -&gt; IO (IOArray i e))
-&gt; ST RealWorld (IOArray i e) -&gt; IO (IOArray i e)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span id="local-6989586621679562499"><span class="annot"><span class="annottext">STArray RealWorld i e
</span><a href="#local-6989586621679562499"><span class="hs-identifier hs-var">marr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(i, i) -&gt; e -&gt; ST RealWorld (STArray RealWorld i e)
forall i e s. Ix i =&gt; (i, i) -&gt; e -&gt; ST s (STArray s i e)
</span><a href="GHC.Arr.html#newSTArray"><span class="hs-identifier hs-var">newSTArray</span></a></span><span> </span><span class="annot"><span class="annottext">(i, i)
</span><a href="#local-6989586621679562502"><span class="hs-identifier hs-var">lu</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679562501"><span class="hs-identifier hs-var">initial</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">IOArray i e -&gt; ST RealWorld (IOArray i e)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">STArray RealWorld i e -&gt; IOArray i e
forall i e. STArray RealWorld i e -&gt; IOArray i e
</span><a href="GHC.IOArray.html#IOArray"><span class="hs-identifier hs-var">IOArray</span></a></span><span> </span><span class="annot"><span class="annottext">STArray RealWorld i e
</span><a href="#local-6989586621679562499"><span class="hs-identifier hs-var">marr</span></a></span><span class="hs-special">)</span><span class="hs-special">}</span><span>
</span><span id="line-55"></span><span>
</span><span id="line-56"></span><span class="hs-comment">-- | Read a value from an 'IOArray'</span><span>
</span><span id="line-57"></span><span id="local-6989586621679562559"><span id="local-6989586621679562560"><span class="annot"><a href="GHC.IOArray.html#unsafeReadIOArray"><span class="hs-identifier hs-type">unsafeReadIOArray</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IOArray.html#IOArray"><span class="hs-identifier hs-type">IOArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562560"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562559"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562559"><span class="hs-identifier hs-type">e</span></a></span></span></span><span>
</span><span id="line-58"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.IOArray.html#unsafeReadIOArray"><span class="hs-pragma hs-type">unsafeReadIOArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-59"></span><span id="unsafeReadIOArray"><span class="annot"><span class="annottext">unsafeReadIOArray :: forall i e. IOArray i e -&gt; Int -&gt; IO e
</span><a href="GHC.IOArray.html#unsafeReadIOArray"><span class="hs-identifier hs-var hs-var">unsafeReadIOArray</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.IOArray.html#IOArray"><span class="hs-identifier hs-type">IOArray</span></a></span><span> </span><span id="local-6989586621679562497"><span class="annot"><span class="annottext">STArray RealWorld i e
</span><a href="#local-6989586621679562497"><span class="hs-identifier hs-var">marr</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679562496"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679562496"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ST RealWorld e -&gt; IO e
forall a. ST RealWorld a -&gt; IO a
</span><a href="GHC.IO.html#stToIO"><span class="hs-identifier hs-var">stToIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">STArray RealWorld i e -&gt; Int -&gt; ST RealWorld e
forall s i e. STArray s i e -&gt; Int -&gt; ST s e
</span><a href="GHC.Arr.html#unsafeReadSTArray"><span class="hs-identifier hs-var">unsafeReadSTArray</span></a></span><span> </span><span class="annot"><span class="annottext">STArray RealWorld i e
</span><a href="#local-6989586621679562497"><span class="hs-identifier hs-var">marr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679562496"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span class="hs-comment">-- | Write a new value into an 'IOArray'</span><span>
</span><span id="line-62"></span><span id="local-6989586621679562552"><span id="local-6989586621679562553"><span class="annot"><a href="GHC.IOArray.html#unsafeWriteIOArray"><span class="hs-identifier hs-type">unsafeWriteIOArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IOArray.html#IOArray"><span class="hs-identifier hs-type">IOArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562553"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562552"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679562552"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span></span><span>
</span><span id="line-63"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.IOArray.html#unsafeWriteIOArray"><span class="hs-pragma hs-type">unsafeWriteIOArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-64"></span><span id="unsafeWriteIOArray"><span class="annot"><span class="annottext">unsafeWriteIOArray :: forall i e. IOArray i e -&gt; Int -&gt; e -&gt; IO ()
</span><a href="GHC.IOArray.html#unsafeWriteIOArray"><span class="hs-identifier hs-var hs-var">unsafeWriteIOArray</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.IOArray.html#IOArray"><span class="hs-identifier hs-type">IOArray</span></a></span><span> </span><span id="local-6989586621679562494"><span class="annot"><span class="annottext">STArray RealWorld i e
</span><a href="#local-6989586621679562494"><span class="hs-identifier hs-var">marr</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679562493"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679562493"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621679562492"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679562492"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ST RealWorld () -&gt; IO ()
forall a. ST RealWorld a -&gt; IO a
</span><a href="GHC.IO.html#stToIO"><span class="hs-identifier hs-var">stToIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">STArray RealWorld i e -&gt; Int -&gt; e -&gt; ST RealWorld ()
forall s i e. STArray s i e -&gt; Int -&gt; e -&gt; ST s ()
</span><a href="GHC.Arr.html#unsafeWriteSTArray"><span class="hs-identifier hs-var">unsafeWriteSTArray</span></a></span><span> </span><span class="annot"><span class="annottext">STArray RealWorld i e
</span><a href="#local-6989586621679562494"><span class="hs-identifier hs-var">marr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679562493"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679562492"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-65"></span><span>
</span><span id="line-66"></span><span class="hs-comment">-- | Read a value from an 'IOArray'</span><span>
</span><span id="line-67"></span><span id="local-6989586621679562545"><span id="local-6989586621679562546"><span class="annot"><a href="GHC.IOArray.html#readIOArray"><span class="hs-identifier hs-type">readIOArray</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562546"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.IOArray.html#IOArray"><span class="hs-identifier hs-type">IOArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562546"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562545"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679562546"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562545"><span class="hs-identifier hs-type">e</span></a></span></span></span><span>
</span><span id="line-68"></span><span id="readIOArray"><span class="annot"><span class="annottext">readIOArray :: forall i e. Ix i =&gt; IOArray i e -&gt; i -&gt; IO e
</span><a href="GHC.IOArray.html#readIOArray"><span class="hs-identifier hs-var hs-var">readIOArray</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.IOArray.html#IOArray"><span class="hs-identifier hs-type">IOArray</span></a></span><span> </span><span id="local-6989586621679562488"><span class="annot"><span class="annottext">STArray RealWorld i e
</span><a href="#local-6989586621679562488"><span class="hs-identifier hs-var">marr</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679562487"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679562487"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ST RealWorld e -&gt; IO e
forall a. ST RealWorld a -&gt; IO a
</span><a href="GHC.IO.html#stToIO"><span class="hs-identifier hs-var">stToIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">STArray RealWorld i e -&gt; i -&gt; ST RealWorld e
forall i s e. Ix i =&gt; STArray s i e -&gt; i -&gt; ST s e
</span><a href="GHC.Arr.html#readSTArray"><span class="hs-identifier hs-var">readSTArray</span></a></span><span> </span><span class="annot"><span class="annottext">STArray RealWorld i e
</span><a href="#local-6989586621679562488"><span class="hs-identifier hs-var">marr</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679562487"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-69"></span><span>
</span><span id="line-70"></span><span class="hs-comment">-- | Write a new value into an 'IOArray'</span><span>
</span><span id="line-71"></span><span id="local-6989586621679562538"><span id="local-6989586621679562539"><span class="annot"><a href="GHC.IOArray.html#writeIOArray"><span class="hs-identifier hs-type">writeIOArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ix.html#Ix"><span class="hs-identifier hs-type">Ix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562539"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.IOArray.html#IOArray"><span class="hs-identifier hs-type">IOArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562539"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562538"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679562539"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679562538"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span></span><span>
</span><span id="line-72"></span><span id="writeIOArray"><span class="annot"><span class="annottext">writeIOArray :: forall i e. Ix i =&gt; IOArray i e -&gt; i -&gt; e -&gt; IO ()
</span><a href="GHC.IOArray.html#writeIOArray"><span class="hs-identifier hs-var hs-var">writeIOArray</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.IOArray.html#IOArray"><span class="hs-identifier hs-type">IOArray</span></a></span><span> </span><span id="local-6989586621679562483"><span class="annot"><span class="annottext">STArray RealWorld i e
</span><a href="#local-6989586621679562483"><span class="hs-identifier hs-var">marr</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679562482"><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679562482"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span id="local-6989586621679562481"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679562481"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ST RealWorld () -&gt; IO ()
forall a. ST RealWorld a -&gt; IO a
</span><a href="GHC.IO.html#stToIO"><span class="hs-identifier hs-var">stToIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">STArray RealWorld i e -&gt; i -&gt; e -&gt; ST RealWorld ()
forall i s e. Ix i =&gt; STArray s i e -&gt; i -&gt; e -&gt; ST s ()
</span><a href="GHC.Arr.html#writeSTArray"><span class="hs-identifier hs-var">writeSTArray</span></a></span><span> </span><span class="annot"><span class="annottext">STArray RealWorld i e
</span><a href="#local-6989586621679562483"><span class="hs-identifier hs-var">marr</span></a></span><span> </span><span class="annot"><span class="annottext">i
</span><a href="#local-6989586621679562482"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679562481"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.IOArray.html#boundsIOArray"><span class="hs-pragma hs-type">boundsIOArray</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-75"></span><span id="local-6989586621679562531"><span id="local-6989586621679562532"><span class="annot"><a href="GHC.IOArray.html#boundsIOArray"><span class="hs-identifier hs-type">boundsIOArray</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IOArray.html#IOArray"><span class="hs-identifier hs-type">IOArray</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562532"><span class="hs-identifier hs-type">i</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679562531"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679562532"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621679562532"><span class="hs-identifier hs-type">i</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-76"></span><span id="boundsIOArray"><span class="annot"><span class="annottext">boundsIOArray :: forall i e. IOArray i e -&gt; (i, i)
</span><a href="GHC.IOArray.html#boundsIOArray"><span class="hs-identifier hs-var hs-var">boundsIOArray</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.IOArray.html#IOArray"><span class="hs-identifier hs-type">IOArray</span></a></span><span> </span><span id="local-6989586621679562479"><span class="annot"><span class="annottext">STArray RealWorld i e
</span><a href="#local-6989586621679562479"><span class="hs-identifier hs-var">marr</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">STArray RealWorld i e -&gt; (i, i)
forall s i e. STArray s i e -&gt; (i, i)
</span><a href="GHC.Arr.html#boundsSTArray"><span class="hs-identifier hs-var">boundsSTArray</span></a></span><span> </span><span class="annot"><span class="annottext">STArray RealWorld i e
</span><a href="#local-6989586621679562479"><span class="hs-identifier hs-var">marr</span></a></span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span></pre></body></html>